<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>分类列表</title>
<import type='css' file="css.main" />
<load href="__PUBLIC__/js/jquery-1.9.1.min.js" />
<import type='js' file="js.main" />
</head>

<body>
<!-- 图片资源开始 -->
<div class="floatBackground" id="floatBackground" style="display: none;">
	<div class="bounced">
		<label class="closeImgResurces">X</label>
		<iframe id="imgResourcesiframe" src="{:rtrim(U('Upload/index'),'.html')}" width="750" height="465" frameborder="0" scrolling="auto"></iframe>
	</div>
</div>
<!-- 图片资源结束 -->
<div class="main-frame">
	<div class="position">大拜年 > 分类列表</div>
	<div class="table-list">
	 <table width="100%" border="1" cellspacing="0" cellpadding="0" class="indextable">
		    <tr class="th-bg">
		      <th width="6%">ID</th>
		      <th width="40%">分类标题</th>
			  <th width="20%">图片地址</th>
			  <th width="5%">排序</th>
		      <th width="10%">操作</th>
	        </tr>
	        <volist name='list' id='v' empty="空数据">
		    <tr class="tr-line">
		      <td>{$v['id']}</td>
		      <td style="text-align:left; padding:0px 6px;">{$v['typename']}</td>
			  <td style="text-align:left; padding:0px 6px;">{$v['typepic']}</td>
			  <td>{$v['typesort']}</td>
		      <td><a href="{:U('edit',array('id'=>$v['id']))}">编辑</a> / <a class="resdel" refurl="{:U('delete',array('id'=>$v['id']))}">删除</a></td>
	        </tr>
	        </volist>
      </table>
    </div>
	<!--表单-->
	<div class="table-list">
		<style>
			.typeform .txt{padding:6px 10px; border:solid 1px #ccc;  border-radius:2px;}
			.typeform{text-align: center; display: block; width: 100%; margin-top: 12px;}
			.typesort{width: 60px;}
			.typepic{width: 250px;}
		</style>
		<form class="typeform" name="form1" id="form1" method="post" action="<if condition="$edit eq 1">{:U('sedit')}<else />{:U('add')}</if>">
			<input type="hidden" name="editid" value="{$data['id']}" />
			<input class="txt typetext" type="text" name="typename" placeholder="分类名称" value="{$data['typename']}"/>
			<input class="txt typesort" type="text" name="typesort" placeholder="排序" value="{$data['typesort']}"/>
			<br>
		    <input name="typepic" id="thumbimg" class="txt typepic" placeholder="缩略图" value="{$data['typepic']}" style="width: 450px;"><a class="browse" f='thumbimg'>浏览···</a>
			<br>
			<input class="typebut" type="submit" value="确 定" class="submitbtn" />
		</form>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$("a.resdel").each(function(index, element) {
			var t = $(this);
			t.click(function(){
				var r=confirm("想好！确定要删除吗？");
				if (r==true){
					var refurl = $(this).attr('refurl');
					location.href = refurl;
				}else{
					return false;
				}
			})
		});
	})
</script>
</body>
</html>
